/****************************************************
* 创建人：  @author ${author}
* 创建时间: ${.now?string("yyyy-MM-dd HH:mm:ss")}
* 项目名称：${cfg.project}
* 文件名称: ${table.controllerName}.ts
* 文件描述: @Description: ${table.comment!} 前端控制器
*
* ${cfg.right}
* ${cfg.copy}
*
********************************************************/

import { Component } from "vue-property-decorator";
import BaseController from "../../common/controller/BaseController";
import ${entity}Service from "../service/${entity}Service";
import PageVO from "../../common/vo/PageVO";
import ${entity}ReqVO from "../vo/${entity}ReqVO";
import ${entity}RepVO from "../vo/${entity}RepVO";
import DialogVO from "../../common/vo/DialogVO";
/**
 * <p>
 * ${table.comment!} 前端控制器
 * </p>
 *
 * @author ${author}
 * @since ${.now?string("yyyy-MM-dd HH:mm:ss")}
 */
@Component({ components: { } })
export default class ${entity}Controller extends BaseController {
    /** service */
    public service: ${entity}Service = new ${entity}Service();
    /** 前端请求VO */
    public reqVO: ${entity}ReqVO = new ${entity}ReqVO();
    /** 分页对象 */
    public pageVO: PageVO = new PageVO();
    /** 详情 */
    public details: ${entity}RepVO = new ${entity}RepVO();

    /**
    * ${table.comment!}  数据准备
    * @Title: mounted
    * @throws
    * @author: ${author}
    * @Date:   ${.now?string("yyyy-MM-dd HH:mm:ss")}
    */
    public mounted() {
        this.reqVO = new ${entity}ReqVO();
        this.$nextTick(() => {
            this.query();
        });
    }

    /**
    * ${table.comment!}列表查询
    * @Title: query
    * @throws
    * @author: ${author}
    * @Date:   ${.now?string("yyyy-MM-dd HH:mm:ss")}
    */
    public query(): void {
        let _this = this;
        this.service.list(this.reqVO).then(res => {
        if (res.winRspType === "ERROR") {
            this.win_message_error(res.msg);
        }
        _this.pageVO = res.data;
        });
    }

    /**
    * ${table.comment!} 分页列表查询
    * @Title: pageQuery
    * @param pageVO
    * @throws
    * @author: ${author}
    * @Date:   ${.now?string("yyyy-MM-dd HH:mm:ss")}
    */
    public pageQuery(pageVO: PageVO) {
        this.reqVO.reqPageNum = pageVO.pageNum;
        this.reqVO.reqPageSize = pageVO.pageSize;
        this.query();
    }

    /**
    * ${table.comment!} 分页列表查询
    * @Title: pageQuery
    * @param reqVO
    * @return com.win.dfas.common.vo.WinResponseData
    * @throws
    * @author: ${author}
    * @Date:   ${.now?string("yyyy-MM-dd HH:mm:ss")}
    */
    public reset(): void {
        this.reqVO = new ${entity}ReqVO();
        this.query();
    }

    /**
    * ${table.comment!} 打开弹框
    * @Title: pageQuery
    * @param reqVO
    * @return com.win.dfas.common.vo.WinResponseData
    * @throws
    * @author: ${author}
    * @Date:   ${.now?string("yyyy-MM-dd HH:mm:ss")}
    */
    public detail(oplog): void {
        this.dialogVO = this.dialogVO.getSeeDialog("日志详情");
        this.details = oplog;
    }
}
